package com.jintian.smart.kernel.orm.dto;

import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.databind.ObjectMapper;

import lombok.Data;

@Data
public class CreateParams<T> {
    private List<T> defaultValues;
    private int batchCount;
    private Map<String, Object> context;

    public static CreateParams<?> valueOf(Map<String, Object> request, Class<?> entityClass, ObjectMapper objectMapper) {
        CreateParams<?> ret = objectMapper.convertValue(request, objectMapper.getTypeFactory().constructParametricType(CreateParams.class, entityClass));
        return ret;
    }
}
